﻿using System;
using Zeus.Thunder.Core;

namespace SharpTrainer.Basic
{
    class SwapArrayElements : ITestCase
    {
        public void Run()
        {
            TestSwapArrayElements();
            Console.ReadLine();
        }

        public static void TestSwapArrayElements()
        {
            int[] someArray = { 1, 2, 3, 4, 5 };

            Console.WriteLine("Array before swap:");
            for (int counter = 0; counter < someArray.Length; counter++)
            {
                Console.WriteLine("Element " + counter + " = " + someArray[counter]);
            }

            ArrayUtil.SwapElementsInArray(someArray, 0, 4);
            Console.WriteLine("Array after swap:");
            for (int counter = 0; counter < someArray.Length; counter++)
            {
                Console.WriteLine("Element " + counter + " = " + someArray[counter]);
            }
        }
    }
}
